﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs.server.serverpackets
{
    public class S_SellHouse : ServerBasePacket
    {
        private static Logger _log = Logger.getLogger( typeof( S_SellHouse ).FullName );

        private byte[] _byte = null;

        public S_SellHouse( int objectId, String houseNumber )
        {
            buildPacket( objectId, houseNumber );
        }

        private void buildPacket( int objectId, String houseNumber )
        {
            writeC( Opcodes.S_OPCODE_INPUTAMOUNT );
            writeD( objectId );
            writeD( 0 ); // ?
            writeD( 100000 ); // スピンコントロールの初期価格
            writeD( 100000 ); // 価格の下限
            writeD( 2000000000 ); // 価格の上限
            writeH( 0 ); // ?
            writeS( "agsell" );
            writeS( "agsell " + houseNumber );
        }

        override
        public byte[] getContent()
        {
            if ( _byte == null )
            {
                _byte = getBytes();
            }
            return _byte;
        }

        override
        public String getType()
        {
            return "[S] S_SellHouse";
        }
    }
}
